package com.example.primeiraaplicacao;

import java.util.ArrayList;

import android.app.Activity;
import android.os.Bundle;
import android.view.Menu;
import android.view.MenuItem;
import android.widget.ArrayAdapter;
import android.widget.Spinner;
import android.widget.Toast;

public class Cadastro extends Activity {
	private ArrayList<String> servidor = new ArrayList<String>();
	
	public void onCreate(Bundle icicle){
		super.onCreate(icicle);
		setContentView(R.layout.cadastro);
		Spinner sp = (Spinner) findViewById(R.id.Servidor);
		servidor.add("-- SELECIONE --");
		servidor.add("Yahoo");
		servidor.add("Hotmail");
		servidor.add("Gmail");
		
		String[] cadastro;
		ArrayAdapter<String> adaptador = new ArrayAdapter<String>(this, 
				android.R.layout.simple_spinner_item, servidor);
		adaptador.setDropDownViewResource(android.R.layout.simple_spinner_item);
		sp.setAdapter(adaptador);
	}
	
	public boolean onCreateOptionsMenu(Menu menu){
		super.onCreateOptionsMenu(menu);
		menu.add(0,0,0,"Salvar");
		menu.add(0,1,0,"Sair");

		return true;
	}
	public boolean onMenuItemSelected(int featureId, MenuItem item){
		switch (item.getItemId()){
		case 0:
		break;
		case 1:
			finish();
			break;
					
		}
		return false;
	}

}
